import request from '@/utils/request'

// 往来单位列表
export function fetchEntList(params) {
  return request({
    url: '/operation/opEnt/queryList',
    method: 'get',
    params: {
      'type': params.type,
      'entName': params.entName,
      'entSimpleName': params.entSimpleName,
      'pageIndex': params.pageIndex,
      'pageSize': params.pageSize
    },
    port: { ENV_PORT: 8004 },
    ajaxType2: 'reqGet'

  })
}

// 往来单位详情
export function fetchEntDetail(id) {
  return request({
    url: '/operation/opEnt/detail',
    method: 'get',
    params: { id },
    port: { ENV_PORT: 8004 },
    ajaxType2: 'reqGet'

  })
}

// 删除往来单位
export function fetchEntDelete(id) {
  return request({
    url: '/operation/opEnt/delete',
    method: 'delete',
    params: { id },
    port: { ENV_PORT: 8004 },
    ajaxType2: 'reqDelete'

  })
}

// 添加往来单位
export function createEntAdd(data) {
  return request({
    url: '/operation/opEnt/add',
    method: 'post',
    data,
    port: { ENV_PORT: 8004 },
    ajaxType2: 'reqPost'

  })
}

// 修改往来单位
export function updateEntArticle(data) {
  return request({
    url: '/operation/opEnt/update',
    method: 'put',
    data,
    port: { ENV_PORT: 8004 },
    ajaxType2: 'reqPut'

  })
}
